<!DOCTYPE html>
<html>
<div id="editForm">
  <div class="form-group">
    <label class="control-label col-xs-3 is-required">记录集名称</label>
    <div class="col-xs-8">
      <div class="input-icon right">
        <input type="text" required id="struct_name_txt" name="name" field="name" class="form-control"/>
      </div>
    </div>
  </div>
  <div class="form-group">
    <label class="control-label col-xs-3">描述信息</label>
    <div class="col-xs-8">
      <div class="input-icon right">
        <input type="text" id="struct_desc_txt" name="desc" field="desc" class="form-control"/>
      </div>
    </div>
  </div>
  <div id="xml_struct_div">
    <div class="form-group">
      <label class="control-label col-xs-3 is-required" id="struct_xpath_title">xpath</label>
      <div class="col-xs-8">
        <div class="input-icon right">
          <input type="text" class="form-control" id="struct_xpath_txt" name="xpath" field="xpath" required/>
        </div>
      </div>
    </div>
  </div>

  <div id="cnpas1_struct_div">
    <div class="form-group">
      <label class="control-label col-xs-3 is-required">报文域前缀</label>
      <div class="col-xs-8">
        <div class="input-icon right">
          <input type="text" class="form-control" id="struct_prefix_txt" name="prefix" field="prefix" required/>
        </div>
      </div>
    </div>
    <div class="form-group">
      <label class="control-label col-xs-3 is-required">报文域后缀</label>
      <div class="col-xs-8">
        <div class="input-icon right">
          <input type="text" class="form-control" id="struct_suffix_txt" name="suffix" field="suffix" required/>
        </div>
      </div>
    </div>
    <div class="form-group">
      <label class="control-label col-xs-3">密押要素</label>
      <div class="col-xs-8">
        <div class="input-icon right">
          <select id="struct_signature_select" name="signature" field="signature" class="form-control select2">
            <option value="true">是</option>
            <option value="false">否</option>
          </select>
        </div>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript">

  $(function () {
    //报文类型
    var nodeType = getPolicyType(pktSelectNode);
    //处理类型：解包unpack,解包：pack
    var processType = pktSelectNode.rootType;
	//初始化页面
	init(nodeType, processType);
    if (pktSelectNode.dataModel) {
      applyDrawing('#editForm', pktSelectNode.dataModel)
    }
  

  })

  function init(nodeType, processType) {
    hideAllDiv();
    if (nodeType == "xml" || nodeType == "cnaps2") {
      hideAll("cnpas1_struct_div");
      disabledAll("cnpas1_struct_div");
      enableAll("xml_struct_div");
      showAll("xml_struct_div");
      $("#struct_xpath_title").html("xpath");
    } else if (nodeType == "cnaps1") {
      hideAll("xml_struct_div");
      disabledAll("xml_struct_div");
      enableAll("cnpas1_struct_div");
      showAll("cnpas1_struct_div");
    } else if (nodeType == "json") {
      hideAll("cnpas1_struct_div");
      disabledAll("cnpas1_struct_div");
      enableAll("xml_struct_div");
      showAll("xml_struct_div");

      $("#struct_xpath_title").html("path");
    }
  }

  function hideAllDiv() {
    hideAll("xml_struct_div");
    hideAll("cnpas1_struct_div");
  }


</script>
